Learn R Programming

circular (version 0.5-1)

projected bivariate normal on the circle: Projected bivariate normal on the circle

Description

The projected normal distribution provides a flexible distribution for circular data, e.g., asymmetry and possible bimodality.

Usage

dpnorm(x, mu, sigma, log = FALSE)
rpnorm(n, mu, sigma, control.circular=list())

Value

dpnorm gives the density, rpnorm generates random deviates.

Arguments

x

a vector. The x and q objects are coerced to class circular.

n

number of observations.

mu

the mean vector of the bivariate normal.

sigma

the 2x2 variance and covariance matrix of the bivariate normal.

log

logical. If TRUE the log of the density is reported.

control.circular

the attribute of the resulting object.

Author

Claudio Agostinelli

References

S.R. Jammalamadaka and A. SenGupta (2001). Topics in Circular Statistics, Section 2.2.4, World Scientific Press, Singapore. K.V. Mardia (1972). Statistics of Directional Data. Academic Press. London and New York. F. Wang and A.E. Gelfand (2013). Directional data analysis under the general projected normal distribution. Stat Methodol. 10(1):113-127. doi:10.1016/j.stamet.2012.07.005.

Examples

Run this code
data1 <- rpnorm(100, mu=c(0,0), sigma=diag(2),
  control.circular=list(units="degrees")) # Uniform on the circle
plot(data1)

ff <- function(x) dpnorm(x, mu=c(0,0), sigma=diag(2)) # Uniform on the circle
curve.circular(ff, join=TRUE,
  main="Density of a Projected Normal Distribution \n mu=(0,0), sigma=diag(2)")

ff <- function(x) dpnorm(x, mu=c(1,1), sigma=diag(2)) # Unimodal
curve.circular(ff, join=TRUE, xlim=c(-1, 2.3),
  main="Density of a Projected Normal Distribution \n mu=(1,1), sigma=diag(2)")

sigma <- matrix(c(1,0.9,0.9,1), nrow=2)  
ff <- function(x) dpnorm(x, mu=c(0.5,0.5), sigma=sigma) # Bimodal
curve.circular(ff, join=TRUE, xlim=c(-1, 2.3),
  main="Density of a Projected Normal Distribution \n mu=(0.5,0.5), rho=0.9")

Run the code above in your browser using DataLab